{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from agent.agent_builder import AgentBuilder \n",
    "import os\n",
    "import time\n",
    "from openai import OpenAI\n",
    "from getpass import getpass\n",
    "\n",
    "os.environ[\"OPENAI_API_KEY\"] = getpass()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "query = input(\"请输入问题\")\n",
    "\n",
    "agent_bulider = AgentBuilder()\n",
    "agents = agent_bulider.build_agents()  \n",
    "\n",
    "previous_solution = None\n",
    "all_solutions = []\n",
    "\n",
    "for agent in agents:\n",
    "    solution = agent.get_solution(query, previous_solution)\n",
    "    all_solutions.append((agent.name, solution))\n",
    "    previous_solution = solution  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for solution_temp in all_solutions:\n",
    "    print(solution_temp[1])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "langchain",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
